package Qgjx;

public class Test {
        public static double LatestNationalWageTaxStandard(double salary) {
                double tax = 0;
                try {
                        if (0 <= salary && salary <= 5000) {
                                tax = 0;
                        }
                        if (5000 < salary && salary <= 8000) {
                                tax = salary * 0.03;
                        }
                        if (8000 < salary && salary <= 17000) {
                                tax = salary * 0.10;
                        }
                        if (17000 < salary && salary <= 30000) {
                                tax = salary * 0.20;
                        }
                        if (30000 < salary && salary <= 40000) {
                                tax = salary * 0.25;
                        }

                } catch (Exception e) {
                        System.out.println("金额有误");
                }
                final double tax1 = tax;
                return tax1;
        }

        public static void SplitLine() {
                for (int i = 1; i < 45; i++) {
                        System.out.print("——");
                }
                System.out.println();
        }

        public static void main(String[] args) {
                String List1[] = { "极好", "好", "不好", "好", "极好", "好", "好", "好", "不好", "好", "好", "好", "极好", "好", "好", "极好","好", "好" };
                String List2[] = { "好", "好", "好", "极好", "好", "好", "不好", "好", "不好", "极好", "极好", "极好", "极好","极好", "不好", "极好", "极好", "极好" };
                String List3[] = {"极好","极好","好","好","好","不好","好","不好","极好","不好","极好","好","好","好","极好","好","好","好"};

                Laboratory lab1 = new Laboratory("计算机网络实验室", 1, List1);
                Laboratory lab2 = new Laboratory("组成原理实验室", 2, List2);
                Laboratory lab3 = new Laboratory("物理实验室", 3, List3);

                Laboratory moren1[] = new Laboratory[5];
                Laboratory moren2[] = new Laboratory[5];

                Student std1 = new Student("student1", moren1, 0);
                Student std2 = new Student("student2", moren2, 0);

                std1.setlaboratory(0, moren1, lab1);
                std1.setlaboratory(1, moren1, lab2);
                std2.setlaboratory(2, moren2, lab3);


                std1.WorkStudyIncome(lab1.getscore(), std1);
                std1.WorkStudyIncome(lab2.getscore(), std1);
                std2.WorkStudyIncome(lab3.getscore(), std2);


                System.out.println("欢迎使用学生实验室勤工俭学模拟系统");

                System.out.println("student1负责丨" + std1.getlaboratory()[0].getlabname() + "丨以及丨"
                        + std1.getlaboratory()[1].getlabname() + "丨");

                System.out.println("丨" + std1.getlaboratory()[0].getlabname() + "丨18周检查结果如下:");

                for (int t = 0; t < 18; t++) {
                        System.out.print(std1.getlaboratory()[0].getscore()[t] + " ");
                }
                System.out.println();

                System.out.println("丨" + std1.getlaboratory()[1].getlabname() + "丨18周检查结果如下:");

                for (int t = 0; t < 18; t++) {
                        System.out.print(std1.getlaboratory()[1].getscore()[t] + " ");
                }
                System.out.println();

                System.out.println("纳税前收入为" + std1.getmoney() + "元。");

                std1.losemoney(LatestNationalWageTaxStandard(std1.getmoney()));
                System.out.println("税收后收入为" + std1.getmoney() + "元。");

                System.out.println("student2负责丨" + std2.getlaboratory()[2].getlabname() + "丨");

                System.out.println("丨" + std2.getlaboratory()[2].getlabname() + "丨18周检查结果如下:");

                for (int t = 0; t < 18; t++) {
                        System.out.print(std2.getlaboratory()[2].getscore()[t] + " ");
                }
                System.out.println();



                System.out.println("纳税前收入为" + std2.getmoney() + "元。");

                std2.losemoney(LatestNationalWageTaxStandard(std2.getmoney()));
                System.out.println("税收后收入为" + std2.getmoney() + "元。");

        }
}